/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modele;

/**
 * @author Hadrien
 */

public class TplusBook extends Order {
    public var reduceFare: Boolean on replace {price = if (reduceFare) 6.0 else 12.0};
    override public var description = bind "{quantity} Ticket T+ Book\n{if (reduceFare) "Reduce fare" else "Full fare"}";

    init {
        price = if (reduceFare) 6.0 else 12.0;
        name = "Ticket T+ Book";
    }

    override public function deliver () : Void {
        for (i in [1..quantity]) {
            println("Print a {name} ({if (reduceFare) "reduce fare" else "full fare"})");
        }
    }

}
